<?php

use think\facade\Route;

$domain = ['Access-Control-Allow-Headers' => 'Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-CSRF-TOKEN, X-Requested-With, token, sign'];

/**
 * 商品相关
 */
Route::group('product', function () {
    Route::get('/checkUserLevel', 'product/checkUserLevel')->middleware('verify');
    Route::get('/checkContract', 'product/checkContract')->middleware('verify');
    Route::get('/index', 'product/index');
    Route::get('/hotSearch', 'product/hotSearch');
    Route::get('/cate', 'product/cate');
    Route::get('/read/:id', 'product/read');
    Route::get('/getSpecItemInfo', 'product/getSpecItemInfo');
    Route::post('/collect', 'product/collect')->middleware('verify');
    Route::get('/evaluateList', 'product/evaluateList')->middleware('verify');
    Route::post('/shareCode', 'product/shareCode');
    Route::get('/getVillageIcon', 'product/getVillageIcon');
});

/**
 * 购物车相关
 */
Route::group('productCart', function () {
    Route::get('/index', 'productCart/index');
    Route::post('/add', 'productCart/add');
    Route::post('/edit', 'productCart/edit');
    Route::post('/submit', 'productCart/submit');
})->middleware('verify');

/**
 * 主商城 - 商家相关
 */
Route::group('businessMall', function () {
    Route::get('/index/:id', 'businessMall/index');
    Route::get('/getCate/:business_id', 'businessMall/getCate');
    Route::post('/collect', 'businessMall/collect')->middleware('verify');
});

/**
 * 订单相关
 */
Route::group('order', function () {
    Route::post('/setTemporary', 'order/setTemporary');
    Route::get('/getTemporary', 'order/getTemporary');
    Route::post('/submit', 'order/submit');
    Route::get('/getPayment/:id', 'order/getPayment');
    Route::post('/payment', 'order/payment');
    Route::get('/orderCount', 'order/orderCount');
    Route::get('/getMyOrder', 'order/getMyOrder');
    Route::get('/getMyOrderInfo/:id', 'order/getMyOrderInfo');
    Route::post('/editMyOrder', 'order/editMyOrder');
    Route::get('/evaluateFront/:id', 'order/evaluateFront');
    Route::post('/evaluateSave', 'order/evaluateSave');
    Route::get('/refundFront', 'order/refundFront');
    Route::post('/refundSave', 'order/refundSave');
    Route::get('/getMyRefundOrder', 'order/getMyRefundOrder');
    Route::get('/getMyRefundOrderInfo/:id', 'order/getMyRefundOrderInfo');
    Route::get('/getExpress', 'order/getExpress');
    Route::post('/editRefundOrder', 'order/editRefundOrder');
    Route::get('/orderExp', 'order/orderExp');
    Route::get('/expInfo', 'order/expInfo');
    Route::get('/expList', 'order/expList');
    Route::get('/scanCode', 'order/scanCode');
    Route::get('/payWay', 'order/payWay');
    Route::get('/getWocInfo/:id', 'order/getWocInfo');
})->middleware('verify');
